package cn.wolfcode.crm.mapper;

import cn.wolfcode.crm.domain.Member;
import cn.wolfcode.crm.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface MemberMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Member record);

    Member selectByPrimaryKey(Long id);

    List<Member> selectAll();

    int updateByPrimaryKey(Member record);

    int queryForCount(QueryObject qo);

    List<Member> queryForList(QueryObject qo);

    void updateStateByMemberId(@Param("memberId") Long memberId, @Param("stateId") Long stateId);

    int updatePasswordById(@Param("id") Long id, @Param("oldPassword") String oldPassword, @Param("newPassword") String newPassword);

    void resetPasswordById(@Param("id") Long id, @Param("defaultPassword") String defaultPassword);

    void moveGroup(@Param("id") Long id, @Param("newGroupId") Long newGroupId);

    void addTag(@Param("id") Long id, @Param("newTagId") Long newTagId);

    Member queryByKeyword(String keyword);

    void updateGiftAndInitAccount(@Param("id") Long id, @Param("giftMoney") BigDecimal giftMoney, @Param("rechargeMoney") BigDecimal rechargeMoney);

}